
#if !defined CONNECTION_ADAPTER_H 
#define CONNECTION_ADAPTER_H

#include "RtCnPacketConnection.h"
#include "RtCnRlb.h"

class CConnectionFactory //only for pkg, sender pkg, reconnect, rlb connection
{
public:
	static PktConnectionWithKeepAlive_T *CreateConnection
		(LINK_TYPE type
		, IRtTransport *pTransport
		, ConnectionList_T *pConnectionList
		, IRtTransportSink* pITransportSink);
};

class CConnectionAdaptor 
	: public CPacketConnection_T<CDataPktPDU, true>
{
public:
	CConnectionAdaptor(CAcceptorT<CConnectionAdaptor> *pAcceptor, 
		LINK_TYPE type = ANY_LINK);
	
	void SetAcceptorType(LINK_TYPE acceptType);
protected:
	virtual void OnReceiveConnectRequest(CReqPDU &requestPDU);

private:
	CRtAutoPtr< CAcceptorT<CConnectionAdaptor> > m_pAcceptor;
	LINK_TYPE  m_AcceptLinkType;
	static ConnectionList_T	m_ConnectionList;
};

#endif
